<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<title></title>
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<link rel="stylesheet" type="text/css" href="../css/font-awesome.css" />
	<style>
		.fa-lg {
			font-size: 1.5rem;
		}

		.aui-grid .aui-grid-label {
			font-size: 0.9rem;
		}
	</style>
</head>

<body>
	<header class="aui-bar aui-bar-nav" id="header">
		<h2>颐康营口</h2>
	</header>
	<section class="aui-grid aui-margin-b-15">
		<div class="aui-row">
			<div class="aui-col-xs-4" tapmode data-url="card/oldlist" data-title="身份认证" data-name="oldlist">
				<i class="fa fa-address-card fa-lg"></i>
				<div class="aui-grid-label">
					身份认证
				</div>
			</div>
			<div class="aui-col-xs-4" tapmode onclick="openWin('inspection',api.wgtRootDir + '/html/inspection/list_frm.html')">
				<i class="fa fa-eye fa-lg"></i>
				<div class="aui-grid-label">
					日常巡检
				</div>
			</div>
			<div class="aui-col-xs-4" tapmode data-url="person/index" data-title="老人信息">
				<i class="fa fa-users fa-lg"></i>
				<div class="aui-grid-label">
					老人信息
				</div>
			</div>
			<!--				<div class="aui-col-xs-4" tapmode data-url="face/index" data-title="人脸识别" id="inspection">
					<i class="fa fa-smile-o fa-lg"></i>
					<div class="aui-grid-label">
						人脸识别
					</div>
				</div>
				<div class="aui-col-xs-4" tapmode data-url="qrcode/index" data-title="扫一扫">
					<i class="fa fa-qrcode fa-lg"></i>
					<div class="aui-grid-label">
						扫一扫
					</div>
				</div>-->


			<div class="aui-col-xs-4" onclick="api.call({ type: 'tel_prompt', number: '041712349'});">
				<i class="fa fa-phone-square fa-lg"></i>
				<div class="aui-grid-label">
					服务热线
				</div>
			</div>

			<div class="aui-col-xs-4" tapmode data-url="setting/index" data-title="用户中心">
				<i class="fa fa-user fa-lg"></i>
				<div class="aui-grid-label">
					用户中心
				</div>
			</div>
		</div>
	</section>
</body>
<script id="badgeTemplate" type="text/x-dot-template">
	{{? it.totalRow>0 }}
	<div class="aui-badge" id="badge">{{=it.totalRow}}</div>{{?}}
</script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/doT.js"></script>
<script type="text/javascript" src="../script/util.js"></script>
<script type="text/javascript">
	apiready = function() {
		api.parseTapmode();
		//$api.fixStatusBar($api.byId('header'));
		var header = $api.dom('header');
		var headerH = $api.fixStatusBar(header);
		domEvtClick('div.aui-col-xs-4');
		//
		api.addEventListener({
			name: 'logout'
		}, function(ret, err) {
			if (!ret.value.login) {
				console.log(JSON.stringify(ret));
				api.openFrame({
					name: 'main',
					url: 'login.html',
					rect: {
						x: 0,
						y: 0,
						w: 'auto',
						h: 'auto'
					}
				});
			}
		});
		// 注册设备
		//			api.require('tencentPush').registerPush(function(ret, err) {
		//				if (ret.status) {
		//					api.setPrefs({
		//						key : 'device_token',
		//						value : ret.token
		//					});
		//					console.log("注册成功，token为：" + ret.token);
		//				} else {
		//					console.log("注册失败，错误码：" + err.code + "，错误信息：" + err.msg);
		//				}
		//			});
		// 查询巡检
		// api.ajax({
		// 	url: base + 'admin/inspection/list',
		// 	data: {
		// 		values: {
		// 			type: 1
		// 		}
		// 	}
		// }, function(ret, err) {
		// 	if (ret && ret.code != "-1") {
		// 		var template = $api.byId('badgeTemplate');
		// 		var inspection = $api.byId('inspection');
		// 		var pagefn = doT.template(template.text);
		// 		inspection.insertAdjacentHTML('afterbegin', pagefn(ret));
		// 	}
		// });
	};
</script>

</html>
